package cn.wolfcode.enums;

import lombok.Getter;

/**
 * @Author chenhui
 * @Date 2021/1/14 10:58
 **/
@Getter
public enum ConsumptionStatusEnum {

    CONSUME("待结算",0),
    AUDIT("待审核",1),
    FINISH("归档",2),
    FAILURE("坏账",3);

    private String name;
    private Integer value;

    ConsumptionStatusEnum(String name, Integer value){
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value){
        //获取所有示例
        ConsumptionStatusEnum[] enums = values();
        for (ConsumptionStatusEnum anEnum :  enums) {
            //判断实例中的value是否等于传入的value
            if(anEnum.value.equals(value)){
                return anEnum.name;
            }
        }
        return null;
    }



}
